/*
The MIT License (MIT)

Copyright (c) 2013 Bert Wierenga

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software 
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include "hhdIGame.h"

#include <android/native_activity.h>

namespace hhd
{
	static void onStart(ANativeActivity* in_activity)
	{

	}

	static void onResume(ANativeActivity* in_activity)
	{

	}

	static void* onSaveInstanceState(ANativeActivity* in_activity, size_t* out_size)
	{
		return NULL;
	}

	static void onPause(ANativeActivity* in_activity)
	{

	}

	static void onStop(ANativeActivity* in_activity)
	{

	}

	static void onDestroy(ANativeActivity* in_activity)
	{

	}

	static void onWindowFocusChanged(ANativeActivity* in_activity, int in_has_focus)
	{

	}

	static void onNativeWindowCreated(ANativeActivity* in_activity, ANativeWindow* in_window)
	{

	}

	static void onNativeWindowResized(ANativeActivity* in_activity, ANativeWindow* in_window)
	{

	}

	static void onNativeWindowRedrawNeeded(ANativeActivity* in_activity, ANativeWindow* in_window)
	{

	}

	static void onNativeWindowDestroyed(ANativeActivity* in_activity, ANativeWindow* in_window)
	{

	}

	static void onInputQueueCreated(ANativeActivity* in_activity, AInputQueue* in_input_queue)
	{

	}

	static void onInputQueueDestroyed(ANativeActivity* in_activity, AInputQueue* in_input_queue)
	{

	}

	static void onContentRectChanged(ANativeActivity* in_activity, const ARect* in_rectangle)
	{

	}

	static void onConfigurationChanged(ANativeActivity* in_activity)
	{

	}

	static void onLowMemory(ANativeActivity* in_activity)
	{

	}

	static void setupNativeActivityCallbacks(ANativeActivity& in_activity)
	{
		in_activity.callbacks->onConfigurationChanged = onConfigurationChanged;
		in_activity.callbacks->onContentRectChanged = onContentRectChanged;
		in_activity.callbacks->onDestroy = onDestroy;
		in_activity.callbacks->onInputQueueCreated = onInputQueueCreated;
		in_activity.callbacks->onInputQueueDestroyed = onInputQueueDestroyed;
		in_activity.callbacks->onLowMemory = onLowMemory;
		in_activity.callbacks->onNativeWindowCreated = onNativeWindowCreated;
		in_activity.callbacks->onNativeWindowDestroyed = onNativeWindowDestroyed;
		in_activity.callbacks->onNativeWindowRedrawNeeded = onNativeWindowRedrawNeeded;
		in_activity.callbacks->onNativeWindowResized = onNativeWindowResized;
		in_activity.callbacks->onPause = onPause;
		in_activity.callbacks->onResume = onResume;
		in_activity.callbacks->onSaveInstanceState = onSaveInstanceState;
		in_activity.callbacks->onStart = onStart;
		in_activity.callbacks->onStop = onStop;
		in_activity.callbacks->onWindowFocusChanged = onWindowFocusChanged;
	}
}

// this is your one and only entry point 
void ANativeActivity_onCreate(ANativeActivity* activity,
	void* savedState,
	size_t savedStateSize)
{
	// setup all the event callbacks
	HHD_ASSERT(activity != NULL);
	hhd::setupNativeActivityCallbacks(*activity);

	// create the game and store a pointer to it on the native activity.
	//activity->instance = hhd::IGame

}

namespace hhd
{
	void* IGame::getOsMessageConsumeFunction()
	{
		HHD_ASSERT(false);
		return NULL;
	}
	
	void IGame::updateOS()
	{
		HHD_ASSERT(false);
	}
}